<?xml version="1.0" encoding="ISO-8859-1" ?>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j">
	
	<f:subview id="subviewManterCargo">
	
	<script type="text/javascript">	

	</script>
	
		<rich:modalPanel id="manterCargo" autosized="true" headerClass="height:20px;" resizeable="false" >
			<f:facet name="header">
				<h:outputText value="#{bundle.cargo_titulo_manter}" />
			</f:facet>
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/images/close.gif" styleClass="botao_fechar_popup" id="hideLink">
						<rich:componentControl for="manterCargo" attachTo="hideLink" operation="hide" event="onclick" />
					</h:graphicImage>
				</h:panelGroup>
			</f:facet>
			<b><font color="red"><rich:messages id="msgCargoManter"></rich:messages></font></b>
			<a4j:form ajaxSubmit="true" id="formCargoManter" reRender="cargo_codigo, cargo_descricao">
			<script type="text/javascript">		
						function valida() {
							if (#{facesContext.maximumSeverity == null}) {
								#{rich:component('manterCargo')}.hide();
							}
						}
				</script>	
                <h:panelGrid columns="2">
                	<h:outputLabel value="#{bundle.cargo_codigo}:" for="cargo_codigo" />
                    <h:inputText id="cargo_codigo" value="#{cargoBackBean.cargoFormBean.cargoManter.codigo}" label="#{bundle.cargo_codigo}" readonly="true" disabled="true" size="5" />
                    
                	<h:outputLabel value="#{bundle.cargo_descricao}:" style="color:red;" for="cargo_descricao" />
                    <h:inputText id="cargo_descricao" value="#{cargoBackBean.cargoFormBean.cargoManter.descricao}" label="#{bundle.cargo_descricao}" disabled="#{cargoBackBean.cargoFormBean.isDisabled}" maxlength="30" size="32" />
                </h:panelGrid>
                
                <div class="linha"/>
                
                <a4j:commandButton action="#{cargoBackBean.manterCargo}" value="#{bundle.cargo_btn_gravar}"   oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('manterCargo')}.hide(); " reRender="formCargoConsulta,formCargoPopup" disabled="#{cargoBackBean.cargoFormBean.isDisabled}"/>
                <a4j:commandButton action="#{cargoBackBean.excluirCargo}" value="#{bundle.cargo_btn_excluir}" id="btnExcluir" reRender="formCargoConsulta,formCargoManter" disabled="#{!cargoBackBean.cargoFormBean.isDisabled}" oncomplete="javascript:valida();"/>
                <a4j:commandButton value="#{bundle.cargo_btn_voltar}" id="btnVoltar" reRender="gridCargo" >
                	<rich:componentControl for="manterCargo" attachTo="btnVoltar" operation="hide" event="onclick" />
                </a4j:commandButton>
			</a4j:form>
			
			<div class="linha"/>
			<h:outputLabel value="#{bundle.campos_obrigatorios}" style="color:red;"/> 
		</rich:modalPanel>
	</f:subview>

</html>